<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Cache-Control" content="no-siteapp" />
 <link href="assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="css/style.css"/>
        <link href="assets/css/codemirror.css" rel="stylesheet">
        <link rel="stylesheet" href="assets/css/ace.min.css" />
        <link rel="stylesheet" href="font/css/font-awesome.min.css" />
        <!--[if lte IE 8]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->
		<script src="js/jquery-1.9.1.min.js"></script>
		<script src="assets/layer/layer.js" type="text/javascript" ></script>
        <script src="assets/laydate/laydate.js" type="text/javascript"></script>
        <script src="assets/js/bootstrap.min.js"></script>
		<script src="assets/js/typeahead-bs2.min.js"></script>
		<script src="assets/js/jquery.dataTables.min.js"></script>
		<script src="assets/js/jquery.dataTables.bootstrap.js"></script>
    <script src="js/myRoute.js"></script>
<title>个人信息管理</title>
</head>

<body>
<div class="clearfix">
 <div class="admin_info_style">
    <div class="recording_style">
    <div class="type_title">管理员登陆记录 </div>
    <div class="recording_list">
     <table class="table table-border table-bordered table-bg table-hover table-sort" id="sample-table">
    <thead>
      <tr class="text-c">
        <th width="80">用户ID</th>
        <th width="80">昵称</th>
        <th width="100">类型</th>
        <th>内容</th>
        <th width="120">登陆IP</th>
        <th width="17%">登陆地址</th>
        <th width="150">登陆时间</th>
      </tr>
    </thead>
    <tbody id="content">

    </tbody>
  </table>
    </div>
    </div>
 </div>
</div>
 <!--修改密码样式-->
         <div class="change_Pass_style" id="change_Pass">
            <ul class="xg_style">
             <li><label class="label_name">原&nbsp;&nbsp;密&nbsp;码</label><input name="原密码" type="password" class="" id="password"></li>
             <li><label class="label_name">新&nbsp;&nbsp;密&nbsp;码</label><input name="新密码" type="password" class="" id="Nes_pas"></li>
             <li><label class="label_name">确认密码</label><input name="再次确认密码" type="password" class="" id="c_mew_pas"></li>

            </ul>
     <!--       <div class="center"> <button class="btn btn-primary" type="button" id="submit">确认修改</button></div>-->
         </div>
</body>
</html>
<script>
	$(".recording_style").width($(window).width());
    //当文档窗口发生改变时 触发
  $(window).resize(function(){
	   $(".recording_style").width($(window).width());
  });
</script>
<script>
jQuery(function($) {
		var oTable1 = $('#sample-table').dataTable( {
		"aaSorting": [[ 1, "desc" ]],//默认第几个排序
		"bStateSave": true,//状态保存
    "searching" : false,
		"aoColumnDefs": [
		  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
		  {"orderable":false,"aTargets":[0,2,3,4,5,6]}// 制定列不参与排序
		] } );

        //选择所有
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});

				});
        //选择单个值
        $('#content > tr > td:first-child input:checkbox').on('click' , function(){
          var that = this;
          var curHtml = $(this).parent('label').parent('td').siblings()[0];
          console.log(this);
          $(curHtml).each(function(){
            var val = $(this).text();
            console.log(val);
            });
        });
});

initPage();
//初始化这一页的数据
function initPage() {
    //分页获取数据
    var data = {};
    data.token = localStorage.token;
    data.pageNo = 1;
    data.pageSize = 10;
    $.ajax({
        type: 'get',
        dataType: 'json',
        url: logPage,
        data: data,
        success: function (res) {
            var content = initContent(res.data);
            $('#content').html(content);
        }
    });
}

//动态加载数据内容
function initContent(data) {
    var type =new Array();
    type[1]="Bannel操作";
    type[2]="用户操作";
    var content = "";
    for (var i in data) {
        content += '<tr>\n' +
            '                <td>' + data[i].account_id + '</td>\n' +
            '                <td>' + data[i].name + '</td>\n' +
            '                <td>' + type[data[i].type] + '</td>\n' +
            '                <td>' + data[i].content + '</td>\n' +
            '                <td>' + data[i].ip + '</td>\n' +
            '                <td>' + data[i].ip_address + '</td>\n' +
            '                <td>' + data[i].create_time + '</td>\n' +
            '</tr>\n';
    }
    return content;
}
</script>
